The present invention relates to database management systems and more particularly to a method and system for more efficiently managing connections to database management systems, thereby improving throughput and response time.
Recently the use of the internet has greatly increased. The internet is a collection of networks over which information can be exchanged. The World Wide Web (xe2x80x9cWWWxe2x80x9d) is a facility which links locations on the internet using a particular protocol. The WWW utilizes hypertext markup language (xe2x80x9cHTMLxe2x80x9d) and hypertext transfer protocols (xe2x80x9cHTTPxe2x80x9d) in order to transfer data. The internet allows a user on a first system, known as a client, to access information on another system, known as a server. Typically, the client includes a browser through which the user can view information provided by the server. The server typically includes server software which allows communication to clients on the internet. The server software typically includes run time structures including an initialization thread, a listener thread, and a plurality of worker threads. The initialization thread initializes the server. The listener thread listens for work requests arriving from the internet. The worker threads execute work requests for the server software, including work requests that may require the use of other applications residing on a server.
The information provided by the server could be obtained from one or more database management systems. Database management systems are used by computer systems in order to store information and access the stored information. A database management system is software, which manages one or more databases. A database is a collection of information. Typically, a request for information is received by the server software residing on the server. Such a request for information residing in a database is known as a database request. The database request is assigned to a worker thread for processing. In order for the worker thread to access information in a database, a connection between the worker thread and a database management system is created. Note that there may be multiple instances of the database management system on the server. Once the connection is created, the database request can be executed. When processing of the database request is completed, the connection is then typically terminated.
Although the worker thread can use the database management system to execute the database request, creating connections to the database management system is a complex process and can require the execution of an extremely large number of program instructions. As a result, the creation of connections involves significant overhead and may be very time consuming. Each time another database request requiring use of a database management system is received by the server software and assigned to a worker thread, a new connection must be generated. This is true even if the same database management system is to be used to process the database request. Consequently, processing of requests may be slowed.
Accordingly, what is needed is a system and method for more efficiently managing connections. It would also be beneficial if the system and method allowed requests to be processed more efficiently. The present invention addresses such a need.
The present invention provides a method and system for processing a request utilizing a database management system in a computer system. The database management system manages at least one database. At least one instance of the database management system is available. The computer system includes a plurality of worker threads. The method and system comprise assigning the request to a worker thread of the plurality of worker threads. The worker thread is for aiding in execution of the request. The method and system also comprise providing a connection to a particular instance of the database management system for the worker thread and associating the connection with the worker thread if the worker thread has not previously used the particular instance of the database management system. The method and system further include reusing a connection to a particular instance of the database management system that is associated with the worker thread if the worker thread has previously used the particular instance of the database management system.
According to the system and method disclosed herein, the present invention can reuse connections, thereby increasing system throughput and response time.